import Vue from 'vue'
import template from './template'
class CreateInstance {
  constructor () {
    this.instance = null
  }
  static create () {
    if (!this.instance) {
      const BenConstructor = Vue.extend(template)
      this.instance = new BenConstructor({
        el: document.createElement('div')
      })
      document.body.appendChild(this.instance.$el)
    }
  }
  static showEdit (...arg) {
    this.create()
    return this.instance.showEdit(...arg)
  }
}
export default CreateInstance
